import request from "@/utils/request";
import type { IGetCategoryList } from "./model/Categorymodel";
enum Api {
  getCategoryOneListUrl = `/admin/product/getCategory1`,
  getCategoryTwoListUrl = `/admin/product/getCategory2`,
  getCategoryThreeListUrl = `/admin/product/getCategory3`,
}
// 一级分类请求方式
export const getCategoryOneList = () => {
  return request.get<any, IGetCategoryList>(Api.getCategoryOneListUrl);
};
// 二级分类请求方式
export const getCategoryTwoList = (category1Id: number) => {
  return request.get<any, IGetCategoryList>(
    `${Api.getCategoryTwoListUrl}/${category1Id}`
  );
};
// 三级分类请求方式
export const getCategoryThreeList = (category2Id: number) => {
  return request.get<any, IGetCategoryList>(
    `${Api.getCategoryThreeListUrl}/${category2Id}`
  );
};
